<template>
  <div>
    <div class="alert show" :style="color">
      <p v-html="info"></p>
    </div>
  </div>
</template>
<script>
export default {
  props: ['info', 'recall', 'lock', 'bgcolor'],
  mounted() {
    setTimeout(() => {
      this.$emit('setClose', false)
      if (this.recall !== undefined) {
        this.recall()
      }
    }, 1500)
  },
  computed: {
    color() {
      return this.bgcolor ? 'background-color:' + this.bgcolor : ''
    }
  }
}
</script>

<style lang="scss" scoped>
.alert {
  position: fixed;
  width: 460px;
  min-height: 80px;
  display: flex;
  justify-content: center;
  align-items: center;
  top: 35%;
  left: 50%;
  padding: 25px;
  margin-left: -230px;
  margin-top: -40px;
  background-color: rgba(0, 0, 0, 0.65);
  border-radius: 8px;
  z-index: 12000;
  text-align: center;
  opacity: 0;
}

.alert-mask {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: transparent;
}

.alert.show {
  animation: show 1.5s linear 0s;
  -webkit-animation: show 1.5s linear 0s;
}

.alert p {
  color: #fff !important; // line-height: 80px;
  margin: 0px;
  font-size: 20px;
}

@keyframes show {
  0% {
    transform: translate(0, -10px);
    -webkit-transform: translate(0, -10px);
    opacity: 0;
  }
  20% {
    transform: translate(0, 0);
    -webkit-transform: translate(0, 0);
    opacity: 1;
  }
  100% {
    transform: translate(0, 0);
    -webkit-transform: translate(0, 0);
    opacity: 1;
  }
}
</style>
